//
// Created by yinlijun on 2017/9/30.
//

#ifndef ROCKYSOCKET_ROCKY_SERVER_H
#define ROCKYSOCKET_ROCKY_SERVER_H

#include <stddef.h>
#include "../common/rocky_connection.h"

#ifdef __cplusplus
extern "C" {
#endif

struct RockyServer;

typedef struct RockyServer RockyServer;

RockyServer *rocky_server_create(int thread_count, size_t buf_size, on_received_data on_received,
                                 on_connection_disconnected on_disconnected);

int rocky_server_loop(RockyServer *thiz);

void rocky_server_destroy(RockyServer *thiz);

#ifdef __cplusplus
}
#endif

#endif //ROCKYSOCKET_ROCKY_SERVER_H